$.zhh.events.on("/employee/personnel/account/", function(space, initial, extras) {

	var v = {};

	v.toDisplayName = function(row, field, json, options) {
		return row.nickName || row.realName || row.phone || row.email;
	};
	v.onClickRowOfDept = function(row){
		var mainlist = space.find(".main-datalist");
		var form = mainlist.xcall("getPanel").find(".toolbar-box form");
		var deptCode = row.deptCode == "0" ? "" : row.deptCode;
		form.form("load", { deptCodeStarts:deptCode });
		mainlist.xcall("reload");
	};
	
	v.onCreateFillData = function(e) {
		var leftlist = space.find(".left-datalist");
		var selected = leftlist.xcall("getSelected");
		if (selected) {
			e.form.find("input[textboxname=deptCode]").xcall("setValue", selected.deptCode);
		}
	};

	space.xui(v);
});
$.extend($.fn.validatebox.defaults.rules, {
	userCode : { // 工号
		validator : function(value) {
			return /^[\+\-\._a-z0-9]*$/i.test(value);
		},
		message : "请输入数字或字母"
	},
	rejectMobile : { // 不能是手机号码
		validator : function(value) {
			return !/^(1\d{10})?$/.test(value);
		},
		message : "不允许输入手机号码"
	}
});